package com.qs.base.utils;

import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.telephony.TelephonyManager;
import android.util.Log;

import com.luck.picture.lib.permissions.RxPermissions;

import java.util.UUID;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import me.goldze.mvvmhabit.utils.ToastUtils;

import static android.content.Context.TELEPHONY_SERVICE;

public class SystemUtil {
    /**
     * 获取设备idIMEI
     *
     * @param context
     * @return
     */
    public static String androidId(Context context) {
        String imei = null;
        TelephonyManager tm = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE);
        try {
            imei = tm.getDeviceId();
            if (imei == null) {// android pad
                imei = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);// 平板电脑 Pad获取的imei
            }
        } catch (Exception e) {
        }
        return imei;
    }


    /**
     * 获取手机型号
     *
     * @return 手机型号
     */
    public static String getSystemModel() {
        return android.os.Build.MODEL;
    }

    /**
     * 获取手机厂商
     *
     * @return 手机厂商
     */
    public static String getDeviceBrand() {
        return android.os.Build.BRAND;
    }

}
